from datetime import datetime

from src.baseapp.model import db, CustomDbModel



class TestCaseModel(CustomDbModel):
    __tablename__ = 'testcase'
    # 所属目录id
    directory_id = db.Column(db.Integer, nullable=False)

    # 用例id
    testcase_id = db.Column(db.Integer, primary_key=True, autoincrement=True)

    # 用例名称
    name = db.Column(db.String(255), nullable=False)

    # 优先级 0-3 0为最高优先级，3为最低优先级
    priority = db.Column(db.Integer, nullable=False, default=0)

    # 用例描述
    description = db.Column(db.String(255), nullable=True)

    # 前置条件
    condition = db.Column(db.Text(1000), nullable=True)

    # 用例步骤
    steps = db.Column(db.Text(1000), nullable=False)

    # 预期结果
    expected_result = db.Column(db.Text(1000), nullable=False)

    # 关联版本
    version_id = db.Column(db.Integer, nullable=False)

    # 创建人
    user_id = db.Column(db.Integer, nullable=False)
